﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Maticsoft.Web.Admin
{
    public partial class admin : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["name"] == null || Session["name"].ToString() == "")
            {
                Response.Redirect("../");
            }
            else
            {
                Label1.Text = "欢迎你 " + Session["name"].ToString();
                switch (Session["permisscode"].ToString())
                {
                    case "0001":
                        Label1.Text = Label1.Text + "，权限： 管理员";
                        break;
                    case "0002":
                        Label1.Text = Label1.Text + "，权限： 总编室";
                        break;
                    case "0003":
                        Label1.Text = Label1.Text + "，权限： 分领导";
                        break;
                    case "0004":
                        Label1.Text = Label1.Text + "，权限： 财务部";
                        break;
                    case "0005":
                        Label1.Text = Label1.Text + "，权限： 记者";
                        break;
                    default:
                        Label1.Text = Label1.Text + "，权限： 未知";
                        break;
                }
               
            }
        }

        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            Session.Clear();
            Response.Write("<script>alert('退出成功！')</script>");
            Response.Redirect("../");
        }
    }
}